﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Weapon : MonoBehaviour {

	protected int id;
	protected string name;//武器名字
	protected string nameChina;//中文名
	protected int typeId;//类型id
	protected string typeName;//类型名字
	protected string grade;//等级
	protected int isAuto;//是否自动
	protected int baseType;//基础类型
	protected float speed;//飞行速度
	public float durationTime;//持续时间
	protected float attackRateTime;//cd
	protected float damage;//攻击力
	protected float attackDistance;//攻击范围
	protected string icon;//图标资源
	protected string prefab_body;//战斗贴图
	protected string prefab_explosion;//爆炸效果
	protected string musicStart;//发射声音
	protected string musicEnd;//结束声音
	protected int specOne;//特殊能力1
	protected int specTwo;//特殊能力2
	protected int specThree;//特殊能力3

	protected float timer = 0;//计时器
	public bool trigger = true;//标记是敌人还是玩家的子弹
	


	public void SetWeaponInfo(WeaponInfo weaponInfo){
		if(weaponInfo != null)
		{
		this.id = weaponInfo.ID;
		this.name = weaponInfo.Name;
		this.nameChina = weaponInfo.NameChina;
		this.typeId = weaponInfo.TypeId;
		this.typeName = weaponInfo.TypeName;
		this.grade = weaponInfo.Grade;
		this.isAuto = weaponInfo.IsAuto;
		this.baseType = weaponInfo.BaseType;
		this.speed = weaponInfo.Speed;
		this.durationTime = weaponInfo.DurationTime;
		this.attackRateTime = weaponInfo.AttackRateTime;
		this.damage = weaponInfo.Damage;
		this.attackDistance = weaponInfo.AttackDistance;
		this.icon = weaponInfo.Icon;
		this.prefab_body = weaponInfo.Prefab_body;
		this.prefab_explosion = weaponInfo.Prefab_explosion;
		this.musicStart = weaponInfo.MusicStart;
		this.musicEnd = weaponInfo.MusicEnd;
		this.specOne = weaponInfo.SpecOne;
		this.specTwo = weaponInfo.SpecTwo;
		this.specThree = weaponInfo.SpecThree;
		}
		

	}

	public void ShowSelf(){
		Debug.Log("id-------------------->" + id);
		Debug.Log("name------------------>" + name);
		Debug.Log("nameChina------------->" + nameChina);
		Debug.Log("typeId---------------->" + typeId);
		Debug.Log("typeName-------------->" + typeName);
		Debug.Log("grade----------------->" + grade);
		Debug.Log("isAuto---------------->" + isAuto);
		Debug.Log("baseType-------------->" + baseType);
		Debug.Log("speed----------------->" + speed);
		Debug.Log("durationTime---------->" + durationTime);
		Debug.Log("attackRateTime-------->" + attackRateTime);
		Debug.Log("damage---------------->" + damage);
		Debug.Log("attackDistance-------->" + attackDistance);
		Debug.Log("icon------------------>" + icon);
		Debug.Log("prefab_body----------->" + prefab_body);
		Debug.Log("prefab_explosion------>" + prefab_explosion);
		Debug.Log("musicStart------------>" + musicStart);
		Debug.Log("musicEnd-------------->" + musicEnd);
		Debug.Log("specOne--------------->" + specOne);
		Debug.Log("specTwo--------------->" + specTwo);
		Debug.Log("specThree------------->" + specThree);
	}
	
}
